/*
 * Bismillahirrahmanirrahim...
 * Software ini bebas untuk anda gunakan dan kembangkan
 * Segala resiko akibat penggunaan software ini ditanggung sendiri ya...
 * Semoga bermanfaat, Amin...
 */

package KomponenGUI;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
import javax.swing.JPanel;

/**
 *
 * @author farazinux
 */
public class Panel extends JPanel {

    private Paint paint;
    private Paint glass;
    private Shape shape;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D gd = (Graphics2D) g.create();

        paint = new GradientPaint(0, 0, Color.black, 0, getHeight(), new Color(getBackground().getRed(), getBackground().getGreen(), getBackground().getBlue()));
        glass = new GradientPaint(0, 0, new Color(1F, 1F, 1F, 0.5F), 0, getHeight(), new Color(1F, 1F, 1F, 0F));
        shape = new Rectangle2D.Double(0, 0, getWidth(), getHeight());
        gd.setPaint(paint);
        gd.fill(shape);

        gd.setPaint(glass);
        gd.fill(shape);

        gd.dispose();

    }

}
